package com.LeetCode;

public class _1两数之和
{
    public static void main(String[] args)
    {
        int arr[] = new int[]{3,6,19,15};
        System.out.println(fun(arr, 22)[0]);
        System.out.println(fun(arr, 22)[1]);
    }

    public static int[] fun(int[] nums, int target)
    {
        int[] arr = new int[2];
        for (int i = 0; i < nums.length; i++)
        {
            for (int j = i + 1; j < nums.length; j++)
            {
                if ((nums[i] + nums[j]) == target)
                {
                    arr = new int[]{i, j};
                }
            }
        }
        return arr;
    }
}
